package com.ccb.testcenter.configuration;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

import com.ccb.testcenter.configuration.io.Resources;


public class Test1 {
	public static void test(){
		try {
			InputStream in=Resources.getResourceAsStream("pom.xml");
			XPathParser x= new XPathParser(in);
			XNode xnode=x.evalNode("/configuration");
			List<XNode> list=	xnode.evalNodes("property");
			System.out.println(list.toString());
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	public static void main(String[] args) {
		//test();
	//	test4();
        test2();
	}
	
	public static void test2(){
		try {
			InputStream in=Resources.getResourceAsStream("struts2.xml");
			XMLAthenaBuilder parser = new XMLAthenaBuilder(in);
			parser.parse();
			
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	
	public void test3(){
		try {
			InputStream in=Resources.getResourceAsStream("xtest.xml");
			XPathParser x= new XPathParser(in,true,null,new XMLTestEntryResolver());
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public static void test4(){
		System.out.println("11111111111111111");
	}
//	public static void test5(Object obj, String name, String value){
//		 Class<? extends Object> clazz = obj.getClass();  
//	        try {  
//	        	
//	            String methodName = returnSetMthodName(name);  
//	            Method[] ms = clazz.getMethods();  
//	            for (Method m : ms) {  
//	                if (m.getName().equals(methodName)) {  
//	                    if (m.getParameterTypes().length == 1) {  
//	                        Class<?> clazzParameterType = m.getParameterTypes()[0];  
//	                        setFieldValue(clazzParameterType.getName(), value, m,  
//	                                obj);  
//	                        break;  
//	                    }  
//	                }  
//	            }  
//	        } catch (SecurityException e) {  
//	            throw new RuntimeException(e);  
//	        } catch (IllegalArgumentException e) {  
//	            throw new RuntimeException(e);  
//	        } catch (IllegalAccessException e) {  
//	            throw new RuntimeException(e);  
//	        } catch (InvocationTargetException e) {  
//	            throw new RuntimeException(e);  
//	        }  
//	}

}
